package com.hyt.it.ogt.ykcj.mapper.grade;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.hyt.it.ogt.ykcj.domain.exam.ExamSubjectInfo;
import com.hyt.it.ogt.ykcj.domain.grade.ExamineeSubjectGradeInfo;
import com.hyt.it.ogt.ykcj.domain.vo.ExamineeSubjectGradeInfoVo;
import com.hyt.it.ogt.ykcj.domain.vo.GradeAnalysisTotalDataVo;

/**
 * 考生考试科目成绩信息Mapper接口
 * 
 * @author admin
 * @date 2021-06-17
 */
public interface ExamineeSubjectGradeInfoMapper 
{
    /**
     * 查询考生考试科目成绩信息
     * 
     * @param subjectGradeId 考生考试科目成绩信息ID
     * @return 考生考试科目成绩信息
     */
    public ExamineeSubjectGradeInfo selectExamineeSubjectGradeInfoById(String subjectGradeId);

    /**
     * 查询考生考试科目成绩信息列表
     * 
     * @param examineeSubjectGradeInfo 考生考试科目成绩信息
     * @return 考生考试科目成绩信息集合
     */
    public List<ExamineeSubjectGradeInfo> selectExamineeSubjectGradeInfoList(ExamineeSubjectGradeInfo examineeSubjectGradeInfo);

    /**
     * 新增考生考试科目成绩信息
     * 
     * @param examineeSubjectGradeInfo 考生考试科目成绩信息
     * @return 结果
     */
    public int insertExamineeSubjectGradeInfo(ExamineeSubjectGradeInfo examineeSubjectGradeInfo);

    /**
     * 修改考生考试科目成绩信息
     * 
     * @param examineeSubjectGradeInfo 考生考试科目成绩信息
     * @return 结果
     */
    public int updateExamineeSubjectGradeInfo(ExamineeSubjectGradeInfo examineeSubjectGradeInfo);

    /**
     * 删除考生考试科目成绩信息
     * 
     * @param subjectGradeId 考生考试科目成绩信息ID
     * @return 结果
     */
    public int deleteExamineeSubjectGradeInfoById(String subjectGradeId);

    /**
     * 批量删除考生考试科目成绩信息
     * 
     * @param subjectGradeIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteExamineeSubjectGradeInfoByIds(String[] subjectGradeIds);

    /**
     * 批量插如考试科目成绩信息
     * @param list 考试科目成绩list
     */
    public void batchInsertSubjectGradeInfo(List<ExamineeSubjectGradeInfo> list);

    /**
     * 根据成绩id删除考生考试科目成绩信息
     *
     * @param gradeId 考生成绩id
     * @return 结果
     */
    public void deleteSubjectGradeByGradeId(String gradeId);

    /**
     * 查询考生考试科目成绩信息列表
     *
     * @param gradeId 考试成绩id
     * @return 考生考试科目成绩信息集合
     */
    public List<ExamineeSubjectGradeInfo> selectSubjectGradeInfoListByGradeId(String gradeId);

    /**
     * 更新归档状态
     * @param gradeId
     * @param archivedStatus
     */
    public void updateArchivedStatusByGradeId(@Param("gradeId")String gradeId, @Param("archivedStatus") String archivedStatus);

    /**
     * 查询总实际考生人数
     * @param examId 考试id
     * @return
     */
    public long countActualExamNumByExamId(@Param("examId") String examId);

    /**
     * 查询各个科目考试通过率
     * @param examId
     * @return
     */
    public List<GradeAnalysisTotalDataVo> countSubjectPassNum(@Param("examId") String examId, @Param("passFlag") String passFlag, @Param("analysisType") String analysisType);

    /**
     * 根据考生成绩id查询考试科目成绩有效期信息
     * @param gradeId
     * @return
     */
    public List<ExamSubjectInfo> querySubjectEffectiveDateByGradeId(@Param("gradeId") String gradeId);

    /**
     * 根据考试科目成绩id查询考试科目成绩有效期信息
     * @param subjectGradeId
     * @return
     */
    public ExamSubjectInfo querySubjectEffectiveDateBySubjectGradeId(@Param("subjectGradeId") String subjectGradeId);

    /**
     * 更新归档状态
     * @param list
     */
    public void batchUpdateSbujectGradeInfo(List<ExamineeSubjectGradeInfo> list);

    /**
     * 查询考生科目成绩列表
     * @param gradeIds
     * @param examId
     * @param subjectId
     * @return
     */
    public List<ExamineeSubjectGradeInfoVo>selectByGradeIds(@Param("gradeIds") List<String> gradeIds, @Param("examId") String examId, @Param("subjectId") String subjectId);

    /**
     * 查询科目后成绩列表
     * @param gradeIds
     * @param archivedStatus
     * @return
     */
    public List<ExamineeSubjectGradeInfo>querySubjectGradeInfoListByIds(@Param("gradeIds") List<String> gradeIds);

    public List<ExamineeSubjectGradeInfoVo>selectArchivedSubjectList(@Param("examineeIdCode") String examineeIdCode, @Param("examYear") String examYear,
                                                                     @Param("subjectId") String subjectId, @Param("examNameConfigId") String examNameConfigId);

    /**
     * 根据考试id和科目id查询是否已存在归档成绩
     * @param @param examInfoId
     * @param @param subjectId
     * @param @return
     * @author qisw  
     * @date 2021年8月23日 下午2:55:42
     */
     public int findExamineeSubjectGradeInfoCountByParm(@Param("examInfoId") String examInfoId, @Param("subjectId") String subjectId);
}
